<?php
/* @var $this SaleController */
/* @var $model Sale */
/* @var $form CActiveForm */
?>

<div class="search">

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl('report/saleSearch'),
	'method'=>'get',
)); ?>
        <?php echo $form->label($model,'product_name'); ?>
	<?php
            $criteria=new CDbCriteria;
            $criteria->addCondition("product_name!='' and product_name is not null");
            $criteria->group = 't.product_name';
            echo $form->dropDownList($model,'product_name',CHtml::listData(Sale::model()->findAll($criteria),'product_name','product_name'),
                                    array('empty'=>'所有产品')); ?> 
    <span>时间选择</span>
        <?php 
            if($model->integral_qty!=''){?>
            <input style="width:150px;" id="sale_time" name="saleTime" type="text" value="<?php echo $model->integral_qty; ?>">


            <span>-</span>

            <input style="width:150px;" id="sale_time1" name="saleTime1" type="text" value="<?php echo $model->add_time; ?>">    
        <?php        
            }else{?>
        <input style="width:150px;" id="sale_time" name="saleTime" type="text">
	
        
        <span>-</span>
        	
	<input style="width:150px;" id="sale_time1" name="saleTime1" type="text">            
        <?php        
            }
        ?>

	<?php echo CHtml::submitButton('查 询',array('class'=>'but')); ?>

<?php $this->endWidget(); ?>

</div>
